package org.metasketch.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ModelPackage extends CommonIdentified {

	List<CommonIdentified> children = new ArrayList<CommonIdentified>();
	Map<String, CommonIdentified> childrenByIds = new HashMap<String, CommonIdentified>();

	public List<CommonIdentified> getChildren() {
		return children;
	}

	public void setChildren(List<CommonIdentified> children) {
		this.children = children;
	}

	public Map<String, CommonIdentified> getChildrenByIds() {
		return childrenByIds;
	}

	public void setChildrenByIds(Map<String, CommonIdentified> childrenByIds) {
		this.childrenByIds = childrenByIds;
	}

	public void addChild(CommonIdentified child) {
		children.add(child);
		childrenByIds.put(child.getId(), child);
	}

	public CommonIdentified getById(String id) {
		return childrenByIds.get(id);
	}

}
